#if !defined(AFX_MARKUP_EMPTY_H)
#define AFX_MARKUP_EMPTY_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#include <pgl/markup/MarkupDllInclude.h>

#ifdef _MARKUP_NO_MARKUP

namespace markup
{

class MARKUP_EXT_CLASS CMarkup   
{
public:
	CMarkup();
	CMarkup( LPCTSTR szDoc );
	CMarkup( const CMarkup& markup );
	void operator=( const CMarkup& markup ){};
	virtual ~CMarkup() {};

	// Navigate
	bool Load( LPCTSTR szFileName );
	bool SetDoc( LPCTSTR szDoc );
	bool IsWellFormed();
	bool FindElem( LPCTSTR szName=NULL );
	bool FindChildElem( LPCTSTR szName=NULL );
	bool IntoElem();
	bool OutOfElem();
	void ResetChildPos();
	void ResetMainPos();
	void ResetPos();
	CString GetTagName() const;
	CString GetChildTagName() const;
	CString GetData() const;
	CString GetChildData() const;
	//[CMARKUPDEV
	CString FindGetData( LPCTSTR szName );
	int GetElemIndex() const;
	void GotoElemIndex( int i );
	bool GetOffsets( int* pnStart, int* pnLen, int* pnInStart=NULL, int* pnInLen=NULL ) const;
	bool GetAttribOffsets( LPCTSTR szAttrib, int* pnStart, int* pnLen, int* pnInStart=NULL, int* pnInLen=NULL ) const;
	//]CMARKUPDEV
	CString GetAttrib( LPCTSTR szAttrib ) const;
	CString GetChildAttrib( LPCTSTR szAttrib ) const;
	CString GetAttribName( int n ) const;
	bool SavePos( LPCTSTR szPosName=_T("") );
	bool RestorePos( LPCTSTR szPosName=_T("") );
	CString GetError() const;

	//[CMARKUPDEV
	int FindNode( int nType=0 );
	int GetNodeType();
	bool AddNode( int nType, LPCTSTR szText );
	bool InsertNode( int nType, LPCTSTR szText );
	bool RemoveNode();
	//]CMARKUPDEV

	// Create
	bool Save( LPCTSTR szFileName );
	CString GetDoc() const;
	virtual bool AddElem( LPCTSTR szName, LPCTSTR szData=NULL );
	virtual bool InsertElem( LPCTSTR szName, LPCTSTR szData=NULL );
	virtual bool AddChildElem( LPCTSTR szName, LPCTSTR szData=NULL );
	virtual bool InsertChildElem( LPCTSTR szName, LPCTSTR szData=NULL );
	bool AddAttrib( LPCTSTR szAttrib, LPCTSTR szValue );
	bool AddChildAttrib( LPCTSTR szAttrib, LPCTSTR szValue );
	bool AddAttrib( LPCTSTR szAttrib, int nValue );
	bool AddChildAttrib( LPCTSTR szAttrib, int nValue );
	bool AddSubDoc( LPCTSTR szSubDoc );
	bool InsertSubDoc( LPCTSTR szSubDoc );
	CString GetSubDoc() const;
	bool AddChildSubDoc( LPCTSTR szSubDoc );
	bool InsertChildSubDoc( LPCTSTR szSubDoc );
	CString GetChildSubDoc() const;

	// Modify
	bool RemoveElem();
	bool RemoveChildElem();
	bool SetAttrib( LPCTSTR szAttrib, LPCTSTR szValue );
	bool SetChildAttrib( LPCTSTR szAttrib, LPCTSTR szValue );
	bool SetAttrib( LPCTSTR szAttrib, int nValue );
	bool SetChildAttrib( LPCTSTR szAttrib, int nValue );
	//[CMARKUPDEV
	bool RemoveAttrib( LPCTSTR szAttrib );
	bool RemoveChildAttrib( LPCTSTR szAttrib );
	bool FindSetData( LPCTSTR szName, LPCTSTR szData, int nCDATA=0 );
	//]CMARKUPDEV
	bool SetData( LPCTSTR szData, int nCDATA=0 );
	bool SetChildData( LPCTSTR szData, int nCDATA=0 );

	//[CMARKUPDEV
	// Base64
	static CString EncodeBase64( const BYTE* pBuffer, int nBufferLen );
	static int DecodeBase64( const CString& csBase64, BYTE* pBuffer, int nBufferLen );
	//]CMARKUPDEV
};
};

#endif
#endif
